import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import * as serviceWorker from './serviceWorker';
import Myroute from './API/myroute';
import {BrowserRouter,Route,Switch} from 'react-router-dom';
import {Zheader} from './mainbody/header';
import Userbody from './user/userbody';
import Managerbody from './manager/managerbody';
import Displaybody from './display/displaybody';

function App() {
    return (
        <BrowserRouter className="App">
            <Zheader/>
            <Switch>
                <Route path={'/'} exact component={Displaybody}/>
                <Myroute path={'/userhome'} component={Userbody}/>
                <Myroute path={'/managerhome'} component={Managerbody}/>
            </Switch>
        </BrowserRouter>
    );
}

ReactDOM.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
  document.getElementById('root')
);

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
